<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex flex-wrap align-center justify-center benben-position-layout flex wode_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex align-center justify-between flex-sub wode_fd0_0'>
          <view class='flex align-center self-center wode_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
          </view>
          <text class='wode_fd0_0_c1'>{{$t('个人中心')}}</text>
          <view class='flex align-center self-center justify-end wode_fd0_0_c0'>
            <image class='wode_fd0_0_c2_c0' mode="aspectFit" :src='STATIC_URL+"48.png"' @tap.stop="handleJumpDiy"
              data-type="navigateTo" :data-url="`/pages/xtsz/system/system`"></image>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>

      <view class="flex flex-direction flex-wrap align-stretch justify-center benben-flex-layout">
        <view class='flex align-center justify-between wode_fd1_0' @tap.stop="handleJumpDiy" data-type="navigateTo"
          :data-url="`/pages/wode/myProfile/myProfile`" v-if=" isLogin===true">
          <view class='flex flex-wrap align-center'>
            <image class='wode_fd1_0_c0_c0' mode="aspectFill" :src='userInfo.avatar'></image>
            <text class=' text-cut-2 wode_fd1_0_c0_c1'>{{userInfo.nickname}}</text>
          </view>
        </view>
        <view class='flex align-center justify-between wode_fd1_0' @tap.stop="toLoginDiy()" v-if=" isLogin===false">
          <view class='flex flex-wrap align-center'>
            <image class='wode_fd1_0_c0_c0' mode="aspectFill" :src='STATIC_URL+"97.png"'></image>
            <text class='wode_fd1_1_c0_c1'>{{$t('请登录')}}</text>
          </view>
        </view>
      </view>


      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout wode_flex_2">
        <view class='flex flex-wrap align-center justify-around wode_fd2_0'>
          <template v-for='(item,key0) in JinganList'>
            <view class='flex flex-direction flex-wrap align-center' @tap.stop="dynamicJump(item.href)" :key='key0'>
              <image class='wode_fd2_0_c0_c0' mode="aspectFill" :src='item.thumb'></image>
              <view class=' wode_fd2_0_c0_c1'>{{item.name}}</view>
            </view>
          </template>

        </view>
      </view>

      <!---flex布局flex布局结束-->
      <!---首页-菜单列表flex布局开始-->
      <view class="flex flex-direction align-stretch benben-flex-layout wode_flex_3">
        <view class='flex flex-wrap align-center wode_fd3_0' @tap.stop="handleJumpDiy" data-type="navigateTo"
          :data-url="`/pages/wode/myMerits/myMerits`">
          <image class='wode_fd3_0_c0' mode="aspectFit" :src='STATIC_URL+"49.png"'></image>
          <view class='flex flex-wrap align-center justify-between flex-sub wode_fd3_0_c1'>
            <text class='wode_fd3_0_c1_c0'>{{$t('我的功德')}}</text>
            <image class='wode_fd3_0_c1_c1' mode="aspectFit" :src='STATIC_URL+"98.png"'></image>
          </view>
        </view>
        <view class='flex flex-wrap align-center wode_fd3_0' @tap.stop="handleJumpDiy" data-type="navigateTo"
          :data-url="`/pages/wode/myBuddhist/myBuddhist`">
          <image class='wode_fd3_0_c0' mode="aspectFit" :src='STATIC_URL+"50.png"'></image>
          <view class='flex flex-wrap align-center justify-between flex-sub wode_fd3_0_c1'>
            <text class='wode_fd3_0_c1_c0'>{{$t('我的经文')}}</text>
            <image class='wode_fd3_0_c1_c1' mode="aspectFit" :src='STATIC_URL+"98.png"'></image>
          </view>
        </view>
        <view class='flex flex-wrap align-center wode_fd3_0' @tap.stop="handleJumpDiy" data-type="navigateTo"
          :data-url="`/pages/wode/myFavorites/myFavorites`">
          <image class='wode_fd3_0_c0' mode="aspectFit" :src='STATIC_URL+"51.png"'></image>
          <view class='flex flex-wrap align-center justify-between flex-sub wode_fd3_0_c1'>
            <text class='wode_fd3_0_c1_c0'>{{$t('我的收藏')}}</text>
            <image class='wode_fd3_0_c1_c1' mode="aspectFit" :src='STATIC_URL+"98.png"'></image>
          </view>
        </view>
        <view class='flex flex-wrap align-center wode_fd3_0' @tap.stop="handleJumpDiy" data-type="navigateTo"
          :data-url="`/pages/xtsz/feedBack/feedBack`">
          <image class='wode_fd3_0_c0' mode="aspectFit" :src='STATIC_URL+"52.png"'></image>
          <view class='flex flex-wrap align-center justify-between flex-sub wode_fd3_0_c1'>
            <text class='wode_fd3_0_c1_c0'>{{$t('意见反馈')}}</text>
            <image class='wode_fd3_0_c1_c1' mode="aspectFit" :src='STATIC_URL+"98.png"'></image>
          </view>
        </view>
        <view class='flex flex-wrap align-center wode_fd3_0' @tap.stop="handleJumpDiy" data-type="navigateTo"
          :data-url="`/pages/wode/inviteFriends/inviteFriends`">
          <image class='wode_fd3_0_c0' mode="aspectFit" :src='STATIC_URL+"53.png"'></image>
          <view class='flex flex-wrap align-center justify-between flex-sub wode_fd3_0_c1'>
            <text class='wode_fd3_0_c1_c0'>{{$t('邀请好友')}}</text>
            <image class='wode_fd3_0_c1_c1' mode="aspectFit" :src='STATIC_URL+"98.png"'></image>
          </view>
        </view>
        <view class='flex flex-wrap align-center wode_fd3_0' @tap.stop="handleJumpDiy" data-type="navigateTo"
          :data-url="`/pages/wode/contactUs/contactUs`">
          <image class='wode_fd3_0_c0' mode="aspectFit" :src='STATIC_URL+"54.png"'></image>
          <view class='flex flex-wrap align-center justify-between flex-sub wode_fd3_0_c1'>
            <text class='wode_fd3_0_c1_c0'>{{$t('联系我们')}}</text>
            <image class='wode_fd3_0_c1_c1' mode="aspectFit" :src='STATIC_URL+"98.png"'></image>
          </view>
        </view>
      </view>

      <!---首页-菜单列表flex布局结束-->


    </view>
  </view>
</template>
<script>
  import {
    validate
  } from '@/common/utils/validate.js'
  export default {
    components: {},


    data() {
      return {
        "userInfo": {
          "invite_code": "",
          "address": "",
          "address_code": "",
          "hobby": "",
          "tags": "",
          "id": "",
          "userlevel_id": "",
          "mobile": "",
          "real_name": "",
          "avatar": "",
          "account": "",
          "email": "",
          "birthday": "",
          "gender": "",
          "create_time": "",
          "user_money": "",
          "freeze_money": "",
          "total_consumption_money": "",
          "score": "",
          "_mobile": "",
          "coupon": "",
          "collection_count": "",
          "browse_count": "",
          "total_money": "",
          "certified": "",
          "nickname": "",
          "is_pay_password": "",
          "follow_count": "",
          "is_close": ""
        },
        "JinganList": []
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },
      isLogin() {
        return this.$store.state.token == '' ? false : true;
      }
    },
    watch: {},
    onLoad(options) {
      this.getjingangListFunc()
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {
      this.queryUserInfoFunc()
      this.getjingangListFunc()
      uni.setTabBarItem({
        index: 0,
        text: this.$t('首页'),
        iconPath: '/static/tab/tab_diy0.png',
        selectedIconPath: '/static/tab/tab_diy0_active.png'
      })
      uni.setTabBarItem({
        index: 1,
        text: this.$t('灵岩妙音'),
        iconPath: '/static/tab/tab_diy1.png',
        selectedIconPath: '/static/tab/tab_diy1_active.png'
      })
      uni.setTabBarItem({
        index: 2,
        text: this.$t('功德'),
        iconPath: '/static/tab/tab_diy2.png',
        selectedIconPath: '/static/tab/tab_diy2_active.png'
      })
      uni.setTabBarItem({
        index: 3,
        text: this.$t('我的'),
        iconPath: '/static/tab/tab_diy3.png',
        selectedIconPath: '/static/tab/tab_diy3_active.png'
      })
    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      //获取用户详细信息
      async queryUserInfoFunc() {
        if (this.isLogin === true) {
          //请求方法
          //数据验证

          let datauserInfo = await this.$api.get(global.apiUrls.post5c78c4772da97, {

          });

          if (datauserInfo.data.code != 1) {
            this.$message.info(datauserInfo.data.msg);
            return
          }
          let infouserInfo = datauserInfo.data;
          this.userInfo = infouserInfo.data

        }
      },
      //获取轮播
      async getjingangListFunc() {
        //请求方法
        //数据验证

        let dataJinganList = await this.$api.get(global.apiUrls.post655f28714571a, {
          operationnavtype_id: '2'
        });

        if (dataJinganList.data.code != 1) {
          this.$message.info(dataJinganList.data.msg);
          return
        }
        let infoJinganList = dataJinganList.data;
        this.JinganList = infoJinganList.data

      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: url(image-path('47.png')) no-repeat, #F7F3ED;
    background-size: 100% auto;
  }

  .wode_flex_0 {
    background: url(image-path('47.png')) no-repeat;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .wode_fd0_0_c2_c0 {
    width: 36rpx;
    height: 36rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .wode_fd0_0_c1 {
    font-size: 36rpx;
    font-weight: 600;
    color: #333333;
  }

  .wode_fd0_0_c0 {
    width: 120rpx;
  }

  .wode_fd0_0 {
    height: 88rpx;
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .wode_fd1_1_c0_c1 {
    margin: 0rpx 0rpx 0rpx 24rpx;
    font-size: 40rpx;
    font-weight: 500;
    color: #333333;
    max-width: 150rpx;
    -webkit-line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    line-height: 40rpx;
  }

  .wode_fd1_0_c0_c1 {
    margin: 0rpx 0rpx 0rpx 24rpx;
    font-size: 40rpx;
    width: 450rpx;
    font-weight: 500;
    color: #333333;
    -webkit-line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    line-height: 40rpx;
  }

  .wode_fd1_0_c0_c0 {
    width: 124rpx;
    height: 124rpx;
    border-radius: 50%;
  }

  .wode_fd1_0 {
    padding: 32rpx 48rpx 48rpx 48rpx;
  }

  .wode_flex_2 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .wode_fd2_0_c0_c1 {
    color: #333333;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 32rpx;
    margin: 16rpx 0rpx 0rpx 0rpx;
  }

  .wode_fd2_0_c0_c0 {
    width: 106rpx;
    height: 106rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .wode_fd2_0 {
    background: rgba(255, 255, 255, 1);
    border-radius: 40rpx;
    background-size: 100% auto;
    padding: 32rpx 0rpx 32rpx 0rpx;
  }

  .wode_flex_3 {
    background: #FFFFFF;
    margin: 24rpx 32rpx 0rpx 32rpx;
    padding: 0rpx 24rpx 0rpx 24rpx;
    background-size: 100% auto !important;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
  }

  .wode_fd3_0_c1_c1 {
    width: 15rpx;
    height: 26rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .wode_fd3_0_c1_c0 {
    font-size: 30rpx;
    font-weight: 400;
    color: #333333;
    line-height: 36rpx;
  }

  .wode_fd3_0_c1 {
    padding: 32rpx 0rpx 32rpx 0rpx;
  }

  .wode_fd3_0_c0 {
    width: 40rpx;
    height: 40rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    margin: 0rpx 16rpx 0rpx 0rpx;
  }

  .wode_fd3_0 {
    border-bottom: 1px solid #eee;
  }
</style>
